﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ObjectModel.Customer>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Edit</h2>

    <% using (Html.BeginForm(new { controller = "Customer", action = "Save" }))
	   {%>
        <%: Html.ValidationSummary(true)%>
        
        <fieldset>
            <legend>Fields</legend>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Name)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Name)%>
                <%: Html.ValidationMessageFor(model => model.Name)%>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.CorporateName)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.CorporateName)%>
                <%: Html.ValidationMessageFor(model => model.CorporateName)%>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Birthdate)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Birthdate, String.Format("{0:g}", Model.Birthdate))%>
                <%: Html.ValidationMessageFor(model => model.Birthdate)%>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Description)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Description)%>
                <%: Html.ValidationMessageFor(model => model.Description)%>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Document)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Document)%>
                <%: Html.ValidationMessageFor(model => model.Document)%>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.MunicipalInscription)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.MunicipalInscription)%>
                <%: Html.ValidationMessageFor(model => model.MunicipalInscription)%>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.StateInscription)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.StateInscription)%>
                <%: Html.ValidationMessageFor(model => model.StateInscription)%>
            </div>            
                <%: Html.HiddenFor(model => model.Id) %>
            <p>
                <input type="submit" value="Save" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>

